#include <vcl.h>
#pragma hdrstop


#include <System.hpp>


int i = 0, n = 0;
__int64 s = 0;
int a[ 10000/*# range 1..10000*/ ], B[ 10000/*# range 1..10000*/ ];

int main(int argc, char* argv[])
{
  Read( n ); ReadLn( s );
  for ( int stop = n, i = 1; i <= stop; i++)
    Read( a[i - 1] );
  for ( int stop = n, i = 1; i <= stop; i++)
    Read( B[i - 1] );
  for ( int stop = n, i = 1; i <= stop; i++)
    s = s - abs( a[i - 1] - B[i - 1] );
  WriteLn( s );
  return 0;
}
